﻿<UserControl x:Class="ManageImages.View.ManageImagesView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:converter="clr-namespace:Infrastructure.Converters;assembly=Infrastructure"
             xmlns:helper="clr-namespace:Infrastructure.AttachedProperties;assembly=Infrastructure"
             mc:Ignorable="d" 
             d:DesignHeight="454" d:DesignWidth="1018">
    <UserControl.Resources>
        <converter:WCNOLinesConverter x:Key="sourceConverter"/>
        <converter:WCNOConverter x:Key="itemConverter"/>
    </UserControl.Resources>
    <telerik:RadBusyIndicator IsBusy="{Binding IsBusy}" BusyContent="{Binding MessageContent}" DisplayAfter="0" IsIndeterminate="True" >
        <Grid Margin="5">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <!--<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0 8 0 0">
                <TextBlock Text="流水线名:" Margin="0 0 5 0"></TextBlock>
                <TextBox Width="250" Text="{Binding AddedWCNOName,UpdateSourceTrigger=PropertyChanged}" Height="25"></TextBox>
            </StackPanel>-->
            <StackPanel Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Margin="0 8 10 0" Orientation="Vertical" VerticalAlignment="Top">
                <StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Top">
                    <TextBlock Text="流水线名:" Margin="0 0 5 0"></TextBlock>
                    <telerik:RadComboBox ItemsSource="{Binding WCNOLines,Converter={StaticResource sourceConverter}}" 
                                     SelectedItem="{Binding SelectedWCNOLine,Converter={StaticResource itemConverter}}" 
                                     IsEditable="False" Width="80" Margin="0 0 5 0"></telerik:RadComboBox>
                    <TextBlock Text="新建工位:" Margin="0 0 5 0"></TextBlock>
                    <TextBox Width="110" Text="{Binding AddedStationName,UpdateSourceTrigger=PropertyChanged}" Height="25"></TextBox>
                </StackPanel>
                <StackPanel Orientation="Horizontal" Grid.Column="0"  Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0 8 10 0">
                    <!--<telerik:RadButton Width="80" Height="22" Content="添加流水线" Margin="0 0 5 0" Command="{Binding AddWCNOCommand,Mode=TwoWay}"></telerik:RadButton>-->
                    <telerik:RadButton Width="80" Height="22" Content="添加工位" Margin="0 0 5 0" Command="{Binding AddStationNameCommand,Mode=TwoWay}"></telerik:RadButton>
                </StackPanel>
            </StackPanel>
            <StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal" Margin="0 8 0 0">
                <TextBlock Text="流水线名:" Width="100"></TextBlock>
                <telerik:RadComboBox ItemsSource="{Binding WCNOLines,Converter={StaticResource sourceConverter}}" 
                                     SelectedItem="{Binding SelectedDeleteWCNOLine,Converter={StaticResource itemConverter}}" 
                                     IsEditable="False" Width="200"></telerik:RadComboBox>
            </StackPanel>
            <StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" Margin="0 8 0 0">
                <TextBlock Text="已有工位:" Width="100"></TextBlock>
                <telerik:RadListBox Height="150" ItemsSource="{Binding StationNames}" helper:SelectedItemsForRadListBox.MySelectedItems="{Binding SelectedStationNames}" SelectionMode="Multiple" Width="200"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Grid.Column="1"  Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0 8 0 0">
                <!--<telerik:RadButton Width="80" Height="22" Content="删除流水线" Margin="0 0 5 0" Command="{Binding DeleteWCNOCommand,Mode=TwoWay}"></telerik:RadButton>-->
                <telerik:RadButton Width="80" Height="22" Content="删除工位" Margin="0 0 5 0" Command="{Binding DeleteStationNameCommand,Mode=TwoWay}"></telerik:RadButton>
            </StackPanel>
        </Grid>
    </telerik:RadBusyIndicator>
</UserControl>
